<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qwwcolorbutton.cpp -->
<head>
  <title>Qt 1.0: QwwColorButton Class Reference</title>
  <link href="classic-4.6.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">wwWidgets Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230">
<a href="http://www.wysota.eu.org/wwwidgets"><img src="images/ww-logo.png" align="right" width="137" height="41" border="0" /></a>
</td></tr></table><h1 class="title">QwwColorButton Class Reference</h1>
<p>The QwwColorButton class provides a color chooser in form of a button with a popup list <a href="#details">More...</a></p>
<pre> #include &lt;QwwColorButton&gt;</pre><p>Inherits <a href="http://qt.nokia.com/doc/4.7/qpushbutton.html">QPushButton</a>.</p>
<ul>
<li><a href="qwwcolorbutton-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li><div class="fn"><b><a href="qwwcolorbutton.html#colors-prop">colors</a></b> : QStringList</div></li>
<li><div class="fn"><b><a href="qwwcolorbutton.html#currentColor-prop">currentColor</a></b> : QColor</div></li>
<li><div class="fn"><b><a href="qwwcolorbutton.html#dragEnabled-prop">dragEnabled</a></b> : bool</div></li>
<li><div class="fn"><b><a href="qwwcolorbutton.html#showName-prop">showName</a></b> : bool</div></li>
</ul>
<ul>
<li><div bar="2" class="fn"></div>3 properties inherited from <a href="http://qt.nokia.com/doc/4.7/qpushbutton.html#properties">QPushButton</a></li>
<li><div bar="2" class="fn"></div>11 properties inherited from <a href="http://qt.nokia.com/doc/4.7/qabstractbutton.html#properties">QAbstractButton</a></li>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#QwwColorButton">QwwColorButton</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#addColor">addColor</a></b> ( const QColor &amp; <i>color</i>, const QString &amp; <i>name</i> = QString::null )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#colors-prop">colors</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QColor </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#currentColor-prop">currentColor</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#dragEnabled-prop">dragEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#colors-prop">setColors</a></b> ( const QStringList &amp; <i>map</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#dragEnabled-prop">setDragEnabled</a></b> ( bool <i>v</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#setStandardColors">setStandardColors</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#showName-prop">showName</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>10 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qpushbutton.html#public-functions">QPushButton</a></li>
<li><div bar="2" class="fn"></div>21 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qabstractbutton.html#public-functions">QAbstractButton</a></li>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qpaintdevice.html#public-functions">QPaintDevice</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-functions">QObject</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#currentColor-prop">setCurrentColor</a></b> ( const QColor &amp; <i>c</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#showName-prop">setShowName</a></b> ( bool <i>v</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qpushbutton.html#public-slots">QPushButton</a></li>
<li><div bar="2" class="fn"></div>5 public slots inherited from <a href="http://qt.nokia.com/doc/4.7/qabstractbutton.html#public-slots">QAbstractButton</a></li>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwwcolorbutton.html#colorPicked">colorPicked</a></b> ( const QColor &amp; <i>color</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>4 signals inherited from <a href="http://qt.nokia.com/doc/4.7/qabstractbutton.html#signals">QAbstractButton</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 public type inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-variables">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qpushbutton.html#protected-functions">QPushButton</a></li>
<li><div class="fn"></div>14 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qabstractbutton.html#protected-functions">QAbstractButton</a></li>
<li><div class="fn"></div>37 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"></div>1 protected function inherited from <a href="http://qt.nokia.com/doc/4.7/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="http://qt.nokia.com/doc/4.7/qwidget.html#protected-slots">QWidget</a></li>
<li><div class="fn"></div>1 protected type inherited from <a href="http://qt.nokia.com/doc/4.7/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
<li><div class="fn"></div>2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QwwColorButton class provides a color chooser in form of a button with a popup list</p>
<p>This widget provides a push button that can be used to choose a color from either a predefined set or a custom one using a <a href="http://qt.nokia.com/doc/4.7/qcolordialog.html">QColorDialog</a>.</p>
<p>Active color can be changed either by clicking the button and choosing a different entry or by dropping a color from another widget or another application.</p>
<p align="center"><img src="images/qwwcolorbutton.png" alt="QwwColorButton" /></p><p>Colors can be added to the button with <a href="qwwcolorbutton.html#addColor">addColor</a>(), <a href="qwwcolorbutton.html#colors-prop">setColors</a>() or <a href="qwwcolorbutton.html#setStandardColors">setStandardColors</a>().</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="colors-prop"></a>colors : <a href="http://qt.nokia.com/doc/4.7/qstringlist.html">QStringList</a></h3>
<p>This property holds list of colors known to the button.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b>colors</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setColors</b> ( const QStringList &amp; <i>map</i> )</td></tr>
</table>
<p>See also <a href="qwwcolorbutton.html#currentColor-prop">currentColor</a>.</p>
<h3 class="fn"><a name="currentColor-prop"></a>currentColor : <a href="http://qt.nokia.com/doc/4.7/qcolor.html">QColor</a></h3>
<p>This property holds returns the currently chosen color.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QColor </td><td class="memItemRight" valign="bottom"><b>currentColor</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setCurrentColor</b> ( const QColor &amp; <i>c</i> )</td></tr>
</table>
<h3 class="fn"><a name="dragEnabled-prop"></a>dragEnabled : bool</h3>
<p>This property holds this property holds whether the button starts a drag if the user presses and moves the mouse away from the button.</p>
<p>Dragging is disabled by default.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>dragEnabled</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setDragEnabled</b> ( bool <i>v</i> )</td></tr>
</table>
<h3 class="fn"><a name="showName-prop"></a>showName : bool</h3>
<p>This property holds this property holds whether the color name should be displayed on the button.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>showName</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setShowName</b> ( bool <i>v</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QwwColorButton"></a>QwwColorButton::QwwColorButton ( <a href="http://qt.nokia.com/doc/4.7/qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a colour button with a specified <i>parent</i>.</p>
<h3 class="fn"><a name="addColor"></a>void QwwColorButton::addColor ( const <a href="http://qt.nokia.com/doc/4.7/qcolor.html">QColor</a> &amp; <i>color</i>, const <a href="http://qt.nokia.com/doc/4.7/qstring.html">QString</a> &amp; <i>name</i> = QString::null )</h3>
<p>Adds a <i>color</i> with a <i>name</i> to the list of colors to choose from <i>color</i> color to add <i>name</i> name to associate with the color</p>
<h3 class="fn"><a name="clear"></a>void QwwColorButton::clear ()</h3>
<p>Clears the color list</p>
<h3 class="fn"><a name="colorPicked"></a>void QwwColorButton::colorPicked ( const <a href="http://qt.nokia.com/doc/4.7/qcolor.html">QColor</a> &amp; <i>color</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when <i>color</i> is picked and displayed on the button.</p>
<h3 class="fn"><a name="setStandardColors"></a>void QwwColorButton::setStandardColors ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets standard Qt colors as the list of colors to choose from</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2007-2010 Witold Wysota 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">wwWidgets 1.0.0</div></td>
</tr></table></div></address></body>
</html>
